﻿namespace MMessaging.Test.Fahrstuhl.Engine
{
	public class ButtonStateOutsideCabin : ButtonStateBase<ButtonStateOutsideCabin>
	{
		public int FloorNo
		{
			get;
			private set;
		}

		public UpDownEnum UpDown
		{
			get;
			private set;
		}

		public ButtonStateOutsideCabin(
			int floorNo,
			bool pressed,
			UpDownEnum upDown
			)
			: base(pressed)
		{
			FloorNo = floorNo;
			UpDown = upDown;
		}

		public override ButtonStateOutsideCabin CopyTypeSafe()
		{
			return new ButtonStateOutsideCabin(
				floorNo: FloorNo,
				pressed: Pressed,
				upDown: UpDown);
		}

		public override bool IsButton(ButtonStateBase otherButtonState)
		{
			var other = otherButtonState as ButtonStateOutsideCabin;
			if (other != null)
				return FloorNo == other.FloorNo && this.UpDown == other.UpDown;
			return false;
		}
	}
}